package com.clotingshoppos.modules.order.service;

import com.clotingshoppos.common.base.BaseService.BaseService;
import com.clotingshoppos.modules.order.POJO.*;
import com.clotingshoppos.modules.order.entity.OrderDetailEntity;
import com.clotingshoppos.modules.order.entity.OrderEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * @InterfaceName: OrderService
 * @Description: 订单服务层接口
 * @Author: zhandad
 * @Date: 2019-03-15 09:04
 * @Version
 */
public interface OrderService extends BaseService<OrderEntity> {
    
    /** 
    * @Description: 分页查询历史订单 
    * @Param:  
    * @return:  
    * @Author: Izzat 
    * @Date: 2019/4/21  21:24
    */
    Page<OrderEntity> findAll(Pageable pageable);

    /**
    * @Description: 注入一张新的订单 
    * @Param:  
    * @return:  
    * @Author: Izzat 
    * @Date: 2019/4/21  20:38
    */ 
    OrderEntity save(OrderRelate orderRelate);
    
    /** 
    * @Description: 返回指定日期的订单记录 
    * @Param:  
    * @return:  
    * @Author: Izzat 
    * @Date: 2019/4/21  20:18
    */ 
    List<OrderEntity> findByDate();

    /** 
    * @Description: 返回指定日期的营业情况统计 
    * @Param:  
    * @return:  
    * @Author: Izzat 
    * @Date: 2019/4/21  20:19
    */
    StatisticsData statistics(StatisticsData date);

    /**
    * @Description: 返回指定的一张完整订单
    * @Param:
    * @return:
    * @Author: Izzat
    * @Date: 2019/4/24  13:46
    */
    OrderRelate findFullOrder(OrderEntity orderEntity);

    /**
    * @Description: 计算总价的接口
    * @Param:
    * @return:
    * @Author: Izzat
    * @Date: 2019/5/7  22:22
     * @param orderRelate
    */
    Double getTotalPrice(List<OrderDetailEntity> orderRelate);

    /**
    * @Description: 确认支付的接口
    * @Param:
    * @return:
    * @Author: Izzat
    * @Date: 2019/5/9  12:11
     * @param orderEntity
    */
    OrderEntity pay(PayStatus orderEntity);

    /** 
    * @Description: 统计产品销量 
    * @Param:  
    * @return:  
    * @Author: Izzat 
    * @Date: 2019/5/17  14:41
    */ 
    EChartResForProduct CountingClothes();
    
    /** 
    * @Description: 统计指定职员指定时间内销售情况 
    * @Param:  
    * @return:  
    * @Author: Izzat 
    * @Date: 2019/5/19  10:56
    */ 
    EChartResForStuff CountingClothesByStuff(String sutff, String timeSpan);

    /** 
    * @Description: 统计指定时间内不同职员销售额 
    * @Param:  
    * @return:  
    * @Author: Izzat 
    * @Date: 2019/5/19  15:06
    */ 
    EChartResForProduct CountingClothesByStuff(String timeSpan);

    /** 
    * @Description: 按时间统计销量情况 
    * @Param:  
    * @return:  
    * @Author: Izzat 
    * @Date: 2019/5/19  12:21
    */ 
    EChartResForProduct CountingClothesWithTime(String timeSpan);
}
